-- for insurance apply
CREATE TABLE [dbo].[APPLICATION_INSURANCE](
	[applicationID] [int] IDENTITY(1,1) NOT NULL,
	[custID] [nvarchar](50) NULL,
	[applicationStatus] [nvarchar](50) NOT NULL,
	[accountNo] [nvarchar](50) NULL,
	[applicationDate] [date] NULL,
	[startDate] [date] NULL,
	[endDate] [date] NULL,
	[paymentPeriod] [nvarchar](50) NULL,
	[approvalDate] [date] NULL,
	[staffID] [nvarchar](50) NULL,
	[savingAccountNo] [nvarchar](50) NULL,
	[applyCategory] [nvarchar](50) NULL,
	[applyProduct] [nvarchar](50) NULL,
	[productType] [nvarchar](50) NULL,
 CONSTRAINT [PK_APPLICATION_INSURANCE_1] PRIMARY KEY CLUSTERED 
(
	[applicationID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]


CREATE TABLE [dbo].[APPLICATION_INSURANCE_INSURED](
	[insuredId] [int] IDENTITY(1,1) NOT NULL,
	[applicationInsuranceId] [int] NULL,
	[fName] [nvarchar](50) NULL,
	[lName] [nvarchar](50) NULL,
	[NRIC] [nvarchar](50) NULL,
	[nationality] [nvarchar](50) NULL,
	[gender] [nvarchar](50) NULL,
	[marital] [nvarchar](50) NULL,
	[birth] [datetime] NULL,
	[relationship] [nvarchar](50) NULL,
	[planType] [nvarchar](50) NULL,
	[occupation] [nvarchar](50) NULL,
	[telephone] [nvarchar](50) NULL,
	[longStay] [nvarchar](50) NULL,
	[mobile] [nvarchar](50) NULL,
	[email] [nvarchar](50) NULL,
	[address] [nvarchar](50) NULL,
	[postalCode] [nvarchar](50) NULL,
	[employerName] [nvarchar](256) NULL,
	[employerAddress] [nvarchar](256) NULL,
	[business] [nvarchar](256) NULL,
	[qstDisease] [nvarchar](256) NULL,
	[illness] [nvarchar](50) NULL,
	[illDuration] [nvarchar](50) NULL,
	[illTreatment] [nvarchar](50) NULL,
	[illhospital] [nvarchar](500) NULL,
	[otherInsurance] [nvarchar](500) NULL,
	[foreseeable] [nvarchar](500) NULL,
	[bloodPressureIllSystolic] [nvarchar](50) NULL,
	[bloodPressureIllDate] [nvarchar](50) NULL,
	[bloodPressureIllHospital] [nvarchar](500) NULL,
	[HyperlipidaemiaLevel] [nvarchar](50) NULL,
	[HyperlipidaemiaDate] [nvarchar](50) NULL,
	[HyperlipidaemiaHospital] [nvarchar](500) NULL,
	[height] [numeric](8, 3) NULL,
	[weight] [numeric](8, 3) NULL,
	[isSmoker] [nvarchar](50) NULL,
 CONSTRAINT [PK_APPLICATION_INSURANCE_INSURED] PRIMARY KEY CLUSTERED 
(
	[insuredId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]


